<html>
	<head>
		<title>Judo Invorio</title>
		<link href="lib/jqueryui/development-bundle/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css"/>		
		<link href="judoinvorio.css" rel="stylesheet" type="text/css"/>
	</head>
<body>
<?php
	include_once("include/config.php");
	include_once("include/auth.lib.php");
	include_once("include/functions.php");
	
	$Email = $_POST["RECUPERO-EMAIL"];
	$Login = $_POST["RECUPERO-LOGIN"];
	
	$user = getPassword($Login, $Email);
	
	$Username = $user['username'];
	if ($Username == '') {
		header("Refresh: 5;URL=index.php");
		echo '<br/><br/><div class="ui-state-error" align="center">Email non presente ... attendi il reindirizzamento</div>';
	} else {
	
		$Nome = $user['nome'];
		$Password = $user['password'];
		$subject = "Recupero password";
		
		$message = "Spett.Le Palestra $Nome,
	
i vostri dati sono:
		 
Username: $Username
Password: $Password
				
Cordiali saluti";

$headers = 'From: iscrizioni@judoinvorio.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();
	
		mail($Email, $subject, $message, $headers);
		header("Refresh: 5;URL=index.php");
		echo '<br/><br/><div align="center"><b>Email inviata ... attendi il reindirizzamento</b></div>';

	}
?>	

</body>
</html>